import logging,yagmail

def log():
    logging.basicConfig(level=logging.DEBUG,
                        filename='./log.txt',
                        filemode='a+',
                        format='%(levelname)s %(filename)s %(message)s %(asctime)s %(lineno)d ')

def email():
    email = yagmail.SMTP(user='2031077871@qq.com',password='fzacgbiwqslydecf',host='smtp.qq.com')
    email.send(to='2031077871@qq.com',subject='接口测试',contents=[r'C:\Users\LENOVO\PycharmProjects\AutoWMS\homework\log.txt'])
    email.close()